package test

import config.{Global, MyFile}
import org.apache.commons.io.FileUtils

import scala.io.Source
import scala.jdk.CollectionConverters._

object test extends MyFile {

  def main(args: Array[String]): Unit = {
     s"${Global.path}/config/qtl_chr".listFile.foreach{x=>
      val lines = x.readLines.map(_.split("\t")(2))
       FileUtils.writeLines( s"${Global.path}/config/qtl_chr_index/${x.getName}".toFile,lines.asJava)
    }

  }

  def getChr = {
    val x = "H:\\南农油茶数据库\\南荣油茶基因组数据\\南荣基因组\\DataS1-8\\DataS6 eQTL results of C oleifera population/Data S4-2 The details of the trans-eQTLs results.xls"
    val lines = Source.fromFile(x.toFile).getLines()


    lines.foreach { x =>
      val l = x.split("\t")
      val chr = l(1)

      FileUtils.writeStringToFile(s"H:\\南农油茶数据库\\南荣油茶基因组数据\\南荣基因组\\DataS1-8\\DataS6 eQTL results of C oleifera population\\qtls/$chr.txt".toFile, x + "\n", true)

    }
  }
}
